package com.shop.cereshop.agent.dao.notice;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.agent.page.notice.CereNoticeAgentVO;
import com.shop.cereshop.commons.domain.notice.CereNotice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CereNoticeDAO extends BaseMapper<CereNotice> {

  CereNotice selectByPrimaryKey(Long noticeId);

  void insertSelective(CereNotice notice);

  List<CereNoticeAgentVO> getAll(@Param("agentUserId") Long agentUserId, @Param("noticeType") Integer noticeType,
      @Param("receive") Integer receive);

  /**
   * 根据消息ID和用户ID查询消息详情与ifRead状态
   */
  List<CereNoticeAgentVO> getByIdForAgent(@Param("noticeId") Long noticeId, @Param("agentUserId") Long agentUserId);

  /**
   * 查询首页通知（与ifRead状态）
   */
  List<CereNoticeAgentVO> getIndexNoticeForAgent(@Param("agentUserId") Long agentUserId,
      @Param("receive") Integer receive);
}
